﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ASPNETMVC4Tutorial.Models
{
    public class Order
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(100)]
        public string Customer { get; set; }

        //Navigation Property
        public virtual ICollection<OrderDetails> OrderDetails { get; set; }

    }

    public class OrderDetails
    {
        public int Id { get; set; }

        public int Quantity { get; set; }

        public int OrderId { get; set; }

        public int ProductId { get; set; }

        //Navigation PRoperty

        public virtual Product Product { get; set; }

        public virtual Order Order { get; set; }
    }
}